package work.timejay.user.entity.books;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.core.toolkit.IdWorker;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import work.timejay.common.SuperModel;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;

import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * <p>
 * 用户book类型表
 * </p>
 *
 * @author 王文杰
 * @since 2023-11-23
 */
@EqualsAndHashCode(callSuper = true)
@Data
@TableName("user_book_type")
public class UserBookType extends SuperModel<UserBookType> {

    private static final long serialVersionUID = 1L;

    /**
     * book类型id
     */
    @TableField("type_id")
    private Long typeId;

    /**
     * 用户id
     */
    @TableField("user_id")
    private Long userId;

    /**
     * 排序
     */
    @TableField("order_num")
    private Long orderNum;


    public static final String BOOK_ID = "book_id";

    public static final String USER_ID = "user_id";

    public static final String ORDER_NUM = "order_num";

    public static UserBookType createAddEntity(Long typeId, Long userId) {
        UserBookType bean = new UserBookType();
        bean.setTypeId(typeId);
        bean.setUserId(userId);
        bean.setOrderNum(0L);
        bean.setId(IdWorker.getId());
        bean.setCreateTime(LocalDateTime.now());
        return bean;
    }


}
